import Common from '@/api/common';

const state = {
  siteData: [], // 站点数据
};

const mutations = {
  // 1.获取站点 / 地区-国家
  setCommonSiteList(state, list) {
    state.siteData = list;
  },
};

const actions = {
  // 1.获取站点 / 地区-国家
  shopSiteList({ state, commit }) {
    if (state.siteData.length) return;
    Common.getCommonSiteList().then((res) => {
      if (res.code == 200) {
        commit('setCommonSiteList', res.data);
      }
    });
  },
};

const getters = {};

export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters,
};
